import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';

export type GPUDocumentType = HydratedDocument<GPU>;

@Schema()
export class GPU {
  @Prop({ required: true, index: true })
  manufacturers: string; // 制造商

  @Prop({ required: true, index: true })
  code: string; // 芯片代号

  @Prop({ required: true })
  codeName: string; // 芯片名称

  @Prop({ required: true })
  gpuType: string; // 显卡类型

  @Prop({ required: true })
  gpuCapacity: string; // 显存容量

  @Prop({ required: true })
  interfaceType: string; // 接口类型

  @Prop({ required: true })
  memoryFrequency: string; // 显存频率

  @Prop({ required: true })
  power: string; // 供电接口

  @Prop({ required: true })
  cooling: string; // 散热方式

  @Prop({ required: true })
  img_url_arr: string[]; // 图片地址

  @Prop({ required: true })
  price: number; // 价格

  @Prop({ required: true })
  score: number; // 性能评分
}

export const GpuSchema = SchemaFactory.createForClass(GPU);
